#define _CRT_SECURE_NO_WARNINGS 1


#include<string>
#include<iostream>

using namespace std;

int main()
{
	string s1, s2;
	while (cin >> s1 >> s2)
	{
		s1 += s1;
		if (s1.find(s2) != string::npos)
		{
			cout << "yes" << endl;
		}
		else
		{
			cout << "no" << endl;
		}
	}
	
	return 0;
}